<?php define('show_follower_max_num',3)?>

<?php if ($current!='home'&&$current!='like'):?>

<div style="padding-left:15px;">
	<h3><?php echo $blog['bname']?>
		<small>(owned by <?php echo $blog['creator']['uname']?>)</small>
		</h3>
	<?php if ($managed_blog):?><a href=""><i class=""></i>Manage Blog</a><?php endif;?>
	<br/>
	<?php $fo_num = $blog['num_follow']?>
	<?php if($fo_num>0):?>
	<i>Followed by <a href = "#" id = 'follows-link' onclick = "$('#followers_area').toggle('fast')">
	<span id = "follow_num"><?php echo $fo_num;?></span> people.</a></i>
	<div class = "hide org_box" id = "followers_area">
	<span class="org_bot_cor" style = "left:75px;"></span>
		<?php
			$follower_names = '';
			for ($i = 0 ;$i < $fo_num and $i < show_follower_max_num ;$i++){
				$f_name = $blog['followers'][$i]['uname'];
				$f_id = $blog['followers'][$i]['uid'];
				if ($f_name!=$cur_user['uname']){
					$f_name = '<a href = "/MyMicroBlog/index.php/user/info/'.$f_id.'">'.$f_name.'</a>';
					$follower_names .= $f_name;
				} else {
					$f_name = '<a href = "/MyMicroBlog/index.php/user/info/'.$f_id.'">'.'<strong>you</strong>'.'</a>';
					$follower_names = $f_name.$follower_names;
				}
				if ($i<show_follower_max_num-1&&$i<$fo_num-1){
					$follower_names.=' and ';
				} elseif ($i<show_follower_max_num-2&&$i<$fo_num-2){
					$follower_names.=', ';
				} 
			}
			if ($i>show_follower_max_num){
				$follower_names .='and other '.($i - show_follower_max_num).' people.';
			}
			echo $follower_names;
		?>
	</div>
	<?php else :?>
	<i>No one has followed this blog.</i><br/>
	<?php endif;?>
	<?php if (!$managed_blog):?>
	<?php $this->load->view('blog/follow_button');?>	
	<?php endif;?>	
	
</div>

<?php endif;?>

<br/><br/>

<?php if ($this->session->userdata('user_id')): ?>

<?php $this->load->view('blog/new');?>
<ul class="nav nav-list">
	<li><h4>My Blogs</h4></li>
	<li><a href="javascript:void(0);"  id="new-blog-btn"> <i
			class=" icon-plus"></i>Creat New Blog
	</a></li>
	<li class="nav-header">Owned Blogs</li>
  	
  	<?php foreach ($blogs['own'] as $blog):?>
  		<li><a
		href="<?php echo base_url('index.php/blog/index').'/'.$blog['bid']?>">
			<i class="icon-check"></i><?php echo $blog['bname']?></a></li>
  	<?php endforeach;?>
  	
  	<li class="nav-header">Managed Blogs</li>
  	
  	<?php foreach ($blogs['manage'] as $blog):?>
  		<li><a
		href="<?php echo base_url('index.php/blog/index').'/'.$blog['bid']?>">
			<i class="icon-check"></i><?php echo $blog['bname']?></a></li>
  	<?php endforeach;?>
</ul>
<ul class="nav nav-list">
	<li><h4>My Interests</h4></li>
	<li><a href="<?php echo base_url('index.php/blog/index/like')?>"> <i
			class="icon-heart"></i>My Likes
	</a></li>
	<li><a href="<?php echo base_url('##')?>"> <i
			class="icon-tag"></i>My Tags
	</a></li>
	<li><a href="<?php echo base_url('#')?>"> <i
			class="icon-search"></i>My Follows
	</a></li>
</ul>
<?php endif;?>
<script type="text/javascript"
	src="<?php echo base_url("public/script/navi.js")?>"></script>